﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;

namespace TerminationCall.Core {
    public class Layer : ICloneable
    {

        public Field[,] Fields {
            get;
            set;
        }

        public Layer(int horizontalFields) {
            Fields = new Field[horizontalFields, 17];

            for (int x = 0; x < horizontalFields; x++)
            {
                for (int y = 0; y < 17; y++)
                {
                    Fields[x, y] = new Field();
                }                
            }

        }

        public object Clone() {

            int horizontalFields = Fields.GetLength(0);
            int verticalFields = Fields.GetLength(1);

            Layer layer = new Layer(horizontalFields);

            for (int x = 0; x < horizontalFields; x++) {
                for (int y = 0; y < verticalFields; y++) {
                    layer.Fields[x, y] = (Field)Fields[x, y].Clone();
                }
            }

            return layer;

        }
    }
}
